#![allow(incomplete_features)]
#![feature(llvm_asm)]
#![feature(specialization)]
#![deny(missing_docs)]
#![crate_type = "lib"]
#![crate_name = "integer"]
#![allow(unused)]

//! High Precision Decimal Calculation library that can be used for both scientific calculation
//! and photography
//!
//! Integer is simple and easy to use for solving large numbers' basic computation. the library
//! is developed based on Plumb's c library and accelerated by inline assembly if the environment
//! suits (X86_64 based and intel 4th gen core or newer).
//!
//! # How to exploit Integer
//!
//! the easiest way to use Integer is import all items by adding `use integer::prelude::*;` at the
//! top of your module. Next you can create the Integer struct by macro or public functions.
//! ```rust
//! use integer::prelude::*;
//!
//! let rand_a = Integer::random(2048); // generate 2048-bit random number
//! let ref rand_b = Integer::random_prime(2048, 100); // generate 2048-bit random prime number
//!
//! let c = rand_a + rand_b; // adds both, but rand_a will be moved
//! ```

mod mods;

pub mod integer;
pub mod prelude;
pub mod sieve;

/// Creates an Integer instance which according to paramaters. the numeric value is
/// based on the actual value of the parameter.
/// the utilization of the macro is the same as function [`Integer::try_convert`].
///
/// # Example
///
/// ```rust
/// use integer::prelude::*;
///
/// let ten = int!(10);
/// let minus_ten = int!(10, -1);
/// let u8_bias = int!([0_u8, 1]);
/// let u64_bias = int!([0_u64, 1]);
/// ```
///
/// [`Integer::try_convert`]: integer/struct.Integer.html#method.try_convert
#[macro_export]
macro_rules! int {
    () => {
        Integer::Zero()
    };
    ($num:expr) => {
        Integer::try_convert($num, 1)
    };
    ($num:expr, $sign:expr) => {
        Integer::try_convert($num, $sign)
    };
}
